# coding: UTF-8
# ----------
# Project_Name : pythonProject
# File_Name : huangcongbing
# Author : asus
# Date_Time:2022/4/26 14:04
# Description :
# ----------
import unittest  # 导入测试框架

from selenium import webdriver
import time
from selenium.webdriver.common.by import By
from selenium.webdriver.support.wait import WebDriverWait  # 导入显式等待类
from selenium.webdriver.support import expected_conditions  # 导入等待条件
from selenium.webdriver.common.action_chains import ActionChains

class zhyzptest(unittest.TestCase):  #必须继承Tescase
    def setUp(self) -> None:
        self.driver = webdriver.Chrome()
        self.wait = WebDriverWait(self.driver,30)
        self.driver.maximize_window()
        self.driver.get("http://192.168.2.6/cloud/#/my")

    def test(self):
        self.wait.until(expected_conditions.visibility_of_element_located((By.XPATH,'//*[@id="account"]/input')))
        self.driver.find_element(By.XPATH,'//*[@id="account"]/input').send_keys("admin")
        self.driver.find_element(By.XPATH,'//*[@id="password"]/input').send_keys("123456")
        self.driver.find_element(By.XPATH,'//*[@id="authCode"]/div/input').send_keys("8888")
        self.driver.find_element(By.XPATH,'//*[@id="root"]/div/div[1]/form/div[5]/div/div').click()
        # time.sleep(2)



    def testdown(self) :
        self.driver.quit()




